<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\warehouse\validate;

use think\Validate;

/**
 * 仓库验证器
 * @package app\warehouse\validate
 * @author 陈梦晨 <2391157750@qq.com>
 */
class WareHouse extends Validate
{
    //定义验证规则
    protected $rule = [
        'code|仓库编码' => 'require',
        'code|仓库编码' => 'unique:warehouse_list,code',
        'warehousename|仓库名称' => 'require',
        'provinceid|省/市' => 'require',
        'cityid|市/区' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'code.require' => '仓库编码不能为空',
        'code.unique' => '仓库编码已经存在',
        'warehousename.require' => '仓库名称不能为空',
        'provinceid.require' => '请选择省/市',
        'cityid.require' => '请选择市/区',
    ];
}
